$(function () {
    var user = null, 
        thisPage = null,
        requestData = {
          index:0,
          size:100,
        },
        html = [];

    var couponPage = function () {
      this.init();
    };
    couponPage.prototype = {
        init: function () {
            this.initData();
            this.bindEvent();
        },
        initData: function () {
          user = getLocalStorage(STORAGE_MANAGER.user);
          if( !user ){
            redirect("../account/login.html");
          }
          $.ajax({
          	type:"POST",
          	url: CONFIG_MANAGER.RequstUrl + "v1/member/asset/coupon/" + user.id,
          	async:true,
          	data:requestData,
          	headers:{ token:user.token  }
          }).done(function(data){
            
          }).fail(function(data){
            var infor = JSON.parse(data);
            $.toast(infor.message);
          });
        },
        bindEvent: function () {

            //回退
            $("#back").on("tap", function () {
                back();
            });
            
            $("#active").on("tap", function(){
              redirect("../finance/activateCoupon.html");
            });
        }
    };
    
    thisPage = new couponPage();
});
